package com.c2soft.ncmx.exch.jms;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import com.c2soft.ncmx.exch.pojo.Order;

public class JmsReceiver implements MessageListener {
	Logger logger = LogManager.getLogger(MessageListener.class.getName());
	//@Transactional
	@Override
	public void onMessage(Message message) {
		 ObjectMessage objectMessage = (ObjectMessage) message;
		 try {
			Order order=(Order)objectMessage.getObject();
			logger.info(order);
			//System.out.println(order);
		} catch (JMSException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		 
	}
}
